package com.yict.common.util;

import java.io.File;

/**
 * 
 * @author 吴琼宏
 * 
 */
public class LibCopyUtil {
	public static void main(String[] args) {
		File s = new File("D:\\java\\openSource\\xstream\\xstream-1.3.1\\lib\\");
		File o = new File("E:\\allianz\\资料\\apex\\workspace\\epayment\\webapp\\WEB-INF\\lib");
		File[] sf = s.listFiles();
		File[] of = o.listFiles();

		for (int i = 0; i < sf.length; i++) {
			String name = sf[i].getName();
			boolean copy = true;

			if (!name.contains(".jar")) {
				continue;
			}

			for (int j = 0; j < of.length; j++) {
				String oName = of[j].getName();
				if (oName.contains(name.replace(".jar", ""))) {
					System.out.println(name + " 已经存在： " + oName);
					copy = false;
					break;
				}
			}

			if (copy) {
				FileUtil.copyFiles(sf[i], new File(o.getAbsolutePath()));
				System.out.println("复制jar：" + o.getAbsolutePath() + File.separator + name);
			}
		}
	}
}
